package com.lc.zpyh.ui.activity.home;

import android.os.Bundle;
import android.widget.TextView;

import com.hjq.http.EasyHttp;
import com.hjq.http.listener.HttpCallback;
import com.lc.zpyh.R;
import com.lc.zpyh.app.AppActivity;
import com.lc.zpyh.http.request.SelectMyMessageOneApi;
import com.lc.zpyh.http.response.SelectMessageDetailsBean;

import butterknife.BindView;
import butterknife.ButterKnife;

public class NoticeDeatailActivity extends AppActivity {
    @BindView(R.id.tv_messageTheme)
    TextView tvMessageTheme;
    private String id;

    @Override
    protected int getLayoutId() {
        return R.layout.activity_noticedeatail;
    }

    @Override
    protected void initView() {

    }

    @Override
    protected void initData() {

    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        // TODO: add setContentView(...) invocation
        ButterKnife.bind(this);
        id = getIntent().getStringExtra("id");
        selectMyMessageOne();
    }

    private void selectMyMessageOne() {

        EasyHttp.post(this)
                .api(new SelectMyMessageOneApi().setId(id)).request(new HttpCallback<SelectMessageDetailsBean>(this) {

            @Override
            public void onSucceed(SelectMessageDetailsBean data) {
                         if (data.getCode()==0){
                             tvMessageTheme.setText(data.getMessage().getNoticeContent());
                         }
            }
            @Override
            public void onFail(Exception e) {
                super.onFail(e);

            }
        });
    }
}
